<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改单车')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-bicycle-edit" th:object="${bikBicycle}">
            <input name="bikId" th:field="*{bikId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">单车名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" name="type" id="selectType">
                        <option value="1" th:selected="*{type} eq '1'">普通</option>
                        <option value="2" th:selected="*{type} eq '2'">电车</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">价格：</label>
                <div class="col-sm-8">
                    <input name="price" th:field="*{price}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">存放位置：</label>
                <div class="col-sm-8">
                    <input name="location" th:field="*{location}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">单车介绍：</label>
                <div class="col-sm-8">
                    <textarea name="introduce" th:field="*{introduce}" maxlength="100"  class="form-control" type="text" placeholder="请输入房屋简介"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "admin/bicycle";
        $("#form-bicycle-edit").validate({
            focusCleanup: true,
            rules: {
                price: {
                    number: true
                },
            },
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-bicycle-edit').serialize());
            }
        }
    </script>
</body>
</html>